package com.joyintech.enums;

public enum PdClassTypEnum {

    SA("810CK001","01","活期存款"),
    TD("810CK002","01","定期存款"),
    ;

    private String code;
    private String type;
    private String name;

    PdClassTypEnum(String code,String type, String name) {
        this.code = code;
        this.type = type;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }

    public static PdClassTypEnum getNameByCode(String code) {
        for (PdClassTypEnum codeEnum : PdClassTypEnum.values()) {
            if (codeEnum.getCode().equals(code)) {
                return codeEnum;
            }
        }
        return null;
    }

    public static PdClassTypEnum getNameByType(String type) {
        for (PdClassTypEnum codeEnum : PdClassTypEnum.values()) {
            if (codeEnum.name().equals(type)) {
                return codeEnum;
            }
        }
        return null;
    }
}
